home *** CD-ROM | disk | FTP | other *** search
/ Graphics Plus / Graphics Plus.iso / general / modelers / geomview / source.lha / Geomview / src / lib / gprim / sphere / spheresave.c < prev   
Encoding:
C/C++ Source or Header  |  1993-02-10  |  537 b   |  26 lines

  1. #include <stdio.h>
  2. #include "transform.h"
  3. #include "geom.h"
  4. #include "geomclass.h"
  5. #include "sphereP.h"
  6.  
  7. Sphere *SphereFSave(sphere, f, fname) 
  8. Sphere *sphere;
  9. FILE *f;
  10. char *fname;
  11. {
  12.   if (sphere == NULL) return NULL;
  13.   switch(sphere->space) {
  14.   case TM_HYPERBOLIC:
  15.     fprintf(f, "%c", 'H');
  16.     break;
  17.   case TM_SPHERICAL:
  18.     fprintf(f, "%c", 'S');
  19.     break;
  20.   }
  21.   fprintf(f, "SPHERE\n");
  22.   fprintf(f, "%g %g %g %g", sphere->radius, sphere->center.x, 
  23.       sphere->center.y, sphere->center.z);
  24.   return (ferror(f) ? NULL : sphere);
  25. }
  26.